﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Xml.Serialization;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using PhoenixCrabV6.Engine.Images;
using PhoenixCrabV6.Engine.IO;
using PhoenixCrabV6.Engine.IO.Interface;

namespace PhoenixCrabV6.Engine.Screens
{
    [DataContract]
    [KnownType(typeof (InterfaceElement))]
    public class TitleScreen : GameScreen
    {
        //TODO research Data Contract XML Serialization
        //[XmlElement ("StartButton",typeof(InterfaceElement))] -- causes an error as it cannot serialize this interface (apparently)
        [DataMember]
        public IInterfaceElement StartButton { get; set; }

        public override void LoadContent()
        {
            base.LoadContent();
            StartButton.LoadContent();

            //construct image layers
            ScreenLayer sl = new ScreenLayer();
            sl.LayerComponents.Add(StartButton);
            ScreenLayers.Add(sl);
        }


        public override void UnloadContent()
        {
            base.UnloadContent();
            //StartButton.UnloadContent();
        }

        public override void Update(GameTime gametime)
        {
            base.Update(gametime);
            //StartButton.Update(gametime);

            
        }

    }
}
